#ifndef WORLDCOMMAND_H
#define WORLDCOMMAND_H

#include <string>
#include <vector>

#include "shipobject.h"

using namespace std;

class WorldCommand
{
public:

    virtual bool execute() = 0;

};

// a command class that creates a ShipObject
class CreateShipCommand: public WorldCommand
{
public:
    string type; //type of ship
    string image; //image for ship
    int x,y; //location of ship
    bool portrait;


    CreateShipCommand(string initType, string initImage, int initX, int initY, bool initPortrait):
        type(initType), image(initImage), x(initX), y(initY), portrait(initPortrait) { }

    bool execute();
};

// a command class that creates a WaterTile
class CreateTileCommand: public WorldCommand
{
public:
    string image;
    string type;
    int row, col;

    CreateTileCommand(string initType, int initRow, int initCol, string initImage):
        image(initImage), type(initType), row(initRow), col(initCol) {}

    bool execute();
};

class CreateOpponentTileCommand: public WorldCommand
{
public:
    string image, type;
    int row, col;

    CreateOpponentTileCommand(string initType, int initRow, int initCol, string initImage):
        image(initImage), type(initType), row(initRow), col(initCol) {}

    bool execute();
};

// a command class that moves a ship
class MoveCommand: public WorldCommand
{
public:
    int id;
    int row, col;

    MoveCommand(int initId, int initRow, int initCol):
        id(initId), row(initRow), col(initCol) { }

    bool execute();

};

class WorldBuilder {
public:
    void doCommand (WorldCommand *cmd);

    //~ShipBuilder();
};


#endif // WORLDCOMMAND_H
